Don't support CREATE_FOLDER and SAVE for now. UI authorities object to it.
authorMatthias Clasen <mclasen@redhat.com>
Sun, 7 Nov 2004 04:57:04 +0000 (04:57 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 7 Nov 2004 04:57:04 +0000 (04:57 +0000)
2004-11-06  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
Don't support CREATE_FOLDER and SAVE for now. UI authorities
object to it.  (#157384, Seth Nickell)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml
gtk/gtkfilechooserbutton.c

index d6af84867d321b7aa5dd162e9a37163f0fdf4968..07dc19a2d26ff9a8bc5bd418b6fb3d00ddee7da8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property): 
+       Don't support CREATE_FOLDER and SAVE for now. UI authorities
+       object to it.  (#157384, Seth Nickell)
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
        a few hoops to make the tooltip on the filter combo box work
        a bit better. This fixes #157273 and #157074.
index d6af84867d321b7aa5dd162e9a37163f0fdf4968..07dc19a2d26ff9a8bc5bd418b6fb3d00ddee7da8 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property): 
+       Don't support CREATE_FOLDER and SAVE for now. UI authorities
+       object to it.  (#157384, Seth Nickell)
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
        a few hoops to make the tooltip on the filter combo box work
        a bit better. This fixes #157273 and #157074.
index d6af84867d321b7aa5dd162e9a37163f0fdf4968..07dc19a2d26ff9a8bc5bd418b6fb3d00ddee7da8 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property): 
+       Don't support CREATE_FOLDER and SAVE for now. UI authorities
+       object to it.  (#157384, Seth Nickell)
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
        a few hoops to make the tooltip on the filter combo box work
        a bit better. This fixes #157273 and #157074.
index d6af84867d321b7aa5dd162e9a37163f0fdf4968..07dc19a2d26ff9a8bc5bd418b6fb3d00ddee7da8 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property): 
+       Don't support CREATE_FOLDER and SAVE for now. UI authorities
+       object to it.  (#157384, Seth Nickell)
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
        a few hoops to make the tooltip on the filter combo box work
        a bit better. This fixes #157273 and #157074.
index 481d15fa48d34fd647071167f0d8b196f07f963e..b2f53fd3a6a94820fd15e6865e29900e3be0db07 100644 (file)
@@ -28,35 +28,13 @@ property to %TRUE.
 </example>
 
 <para>
-The #GtkFileChooserButton supports all four #GtkFileChooserAction<!--
--->s that the #GtkFileChooser supports.  Two of the actions,
-%GTK_FILE_CHOOSER_ACTION_SAVE and
-%GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, give the button the appearance
-of an entry next to a button.  The user can type the name of a file in
-this entry, and it will complete as it types.  The other two actions,
-%GTK_FILE_CHOOSER_ACTION_OPEN and
-%GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, make the #GtkFileChooserAction
-look like a #GtkButton.
+The #GtkFileChooserButton supports the #GtkFileChooserAction<!--
+-->s %GTK_FILE_CHOOSER_ACTION_OPEN and %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
 </para>
 
-<example>
-<title>Using GtkFileChooserButton in save mode</title>
-<programlisting>
-{
-  GtkWidget *button;
-
-  button = gtk_file_chooser_button_new (_("Save as..."));
-  gtk_file_chooser_set_action (GTK_FILE_CHOOSER (button),
-                               GTK_FILE_CHOOSER_ACTION_SAVE);
-  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER_BUTTON (button),
-                                       DEFAULT_SAVE_DIRECTORY);
-}
-</programlisting>
-</example>
-
 <important>
 <para>
-The #GtkFileChooserButton will ellipsize the label while in Open mode,
+The #GtkFileChooserButton will ellipsize the label,
 and thus will thus request little horizontal space.  To give the button
 more space, you should call gtk_widget_size_request(),
 gtk_file_chooser_button_set_width_chars(), or pack the button in
index 502b061529a82f4d699fdeb14c5c8b2022838aea..b1837459c66f882aaec99dc470d4605baf82d85a 100644 (file)
@@ -496,6 +496,24 @@ gtk_file_chooser_button_set_property (GObject      *object,
       break;
 
     case GTK_FILE_CHOOSER_PROP_ACTION:
+      switch (g_value_get_enum (value))
+       {
+       case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
+       case GTK_FILE_CHOOSER_ACTION_SAVE:
+         {
+           GEnumClass *eclass;
+           GEnumValue *eval;
+
+           eclass = g_type_class_peek (GTK_TYPE_FILE_CHOOSER_ACTION);
+           eval = g_enum_get_value (eclass, g_value_get_enum (value));
+           g_warning ("%s: Choosers of type `%s` do not support `%s'.",
+                      G_STRFUNC, G_OBJECT_TYPE_NAME (object), eval->value_name);
+
+           g_value_set_enum (value, GTK_FILE_CHOOSER_ACTION_OPEN);
+         }
+         break;
+       }
+      
       g_object_set_property (G_OBJECT (priv->dialog), pspec->name, value);
       _gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (priv->entry),
                                          (GtkFileChooserAction) g_value_get_enum (value));